  var db = wx.cloud.database()
  var app = getApp();
Page({

  data: {
     userInfo:{},
     collectGoodsNum:0,
     userAddress:{}
  },
 onShow(){
    const userInfo = wx.getStorageSync('userInfo')
    this.setData({
      userInfo
    })
 },

 aboutUs() {
    wx.navigateTo({
      url: '/pages/author/author',
    })
 },
 getUserInfo(e) {
   console.log(e);
   let {userInfo} =this.data
   userInfo =  e.detail.userInfo
   wx.setStorageSync('userInfo', userInfo)
   this.setData({
      userInfo
   })

 },
 getUserAddress() {
    let that=this
    let{userAddress} =this.data
   wx.chooseAddress({
     success: (res) => {
        userAddress= res
        wx.setStorageSync('userAddress', userAddress)
     },
   })
 }
})